﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

[assembly: Microsoft.Windows.Design.Metadata.ProvideMetadata(typeof(Microsoft.Expression.Prototyping.Mockups.Design.MetadataStore))]

namespace Microsoft.Expression.Prototyping.Mockups.Design
{
#if SILVERLIGHT
	extern alias Silverlight;
	using Grid = Silverlight::System.Windows.Controls.Grid;
	using StackPanel = Silverlight::System.Windows.Controls.StackPanel;
	using TextBlock = Silverlight::System.Windows.Controls.TextBlock;
	using Button = Silverlight::System.Windows.Controls.Button;
	using TextBox = Silverlight::System.Windows.Controls.TextBox;
#else
	using Grid = System.Windows.Controls.Grid;
	using StackPanel = System.Windows.Controls.StackPanel;
	using TextBlock = System.Windows.Controls.TextBlock;
	using Button = System.Windows.Controls.Button;
	using RadioButton = System.Windows.Controls.RadioButton;
	using TextBox = System.Windows.Controls.TextBox;
	using Image = System.Windows.Controls.Image;
#endif

	using System;
	using System.Globalization;
	using System.Collections.Generic;
	using System.ComponentModel;
	using Microsoft.Windows.Design;
	using Microsoft.Windows.Design.Features;
	using Microsoft.Windows.Design.Interaction;
	using Microsoft.Windows.Design.Metadata;
	using Microsoft.Windows.Design.Model;
	using Microsoft.Windows.Design.PropertyEditing;
	using Microsoft.Expression.Prototyping.Mockups.Design.PropertyEditors;

	internal class MetadataStore : IProvideAttributeTable
	{
		private static readonly CategoryAttribute CommonPropertiesCategory = new CategoryAttribute("Common Properties");
		private static readonly ToolboxCategoryAttribute MockupsToolCategory = new ToolboxCategoryAttribute("Mockups");
		private static readonly ToolboxBrowsableAttribute ToolboxBrowsableFalse = new ToolboxBrowsableAttribute(false);
		private static readonly ToolboxBrowsableAttribute ToolboxBrowsableTrue = new ToolboxBrowsableAttribute(true);
		private static readonly BrowsableAttribute NotBrowsable = new BrowsableAttribute(false);
		private static readonly AlternateContentPropertyAttribute AlternateContentProperty = new AlternateContentPropertyAttribute();

		private AttributeTableBuilder attributeTableBuilder;

		// Called by the designer to register any design-time metadata.
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
		public AttributeTable AttributeTable
		{
			get
			{
				if (null == this.attributeTableBuilder)
				{
					this.attributeTableBuilder = new AttributeTableBuilder();
					this.BuildAttributeTable_BaseMockup();
					this.BuildAttributeTable_BlockOfTextMockup();
					this.BuildAttributeTable_ButtonWithIcon();
					this.BuildAttributeTable_CursorMockup();
					this.BuildAttributeTable_DesktopMockup();
					this.BuildAttributeTable_DialogMockup();
					this.BuildAttributeTable_IconMockup();
					this.BuildAttributeTable_OptionButtonWithIcon();
					this.BuildAttributeTable_ToggleButtonWithIcon();
					this.BuildAttributeTable_LogonMockup();
					this.BuildAttributeTable_MediaControlsMockup();
					this.BuildAttributeTable_MediaPlayerMockup();
#if SILVERLIGHT
					this.BuildAttributeTable_MenuMockup();
#endif
					this.BuildAttributeTable_PageSelectorMockup();
					this.BuildAttributeTable_ValueEditorMockup();
					this.BuildAttributeTable_WebBrowserMockup();
					this.BuildAttributeTable_WindowMockup();
					this.BuildAttributeTable_WindowsExplorerMockup();
					// Hide base and composition classes
					this.AddAttribute<IconMockupBase>(MetadataStore.ToolboxBrowsableFalse);
					this.AddAttribute<MiniWrapPanel>(MetadataStore.ToolboxBrowsableFalse);
					this.AddAttribute<UniformGrid>(MetadataStore.ToolboxBrowsableFalse);
					
					this.BuildExampleDescriptions();
				}

				return this.attributeTableBuilder.CreateTable();
			}
		}

		private void BuildExampleDescriptions()
		{
			// Dialog Examples
			this.AddAttribute<OneButtonDialogMockup>(new DescriptionAttribute(StringTable.OneButtonDialogMockupDescription));
			this.AddAttribute<TwoButtonDialogMockup>(new DescriptionAttribute(StringTable.TwoButtonDialogMockupDescription));
			this.AddAttribute<ThreeButtonDialogMockup>(new DescriptionAttribute(StringTable.ThreeButtonDialogMockupDescription));
		}

		#region AttributeTableBuilders
		private void AddAttribute<T>(string propertyName, Attribute attribute)
		{
			this.attributeTableBuilder.AddCustomAttributes(typeof(T), propertyName, attribute);
		}

		private void AddAttribute<T>(Attribute attribute)
		{
			this.attributeTableBuilder.AddCustomAttributes(typeof(T), attribute);
		}

		private void BuildAttributeTable_BaseMockup()
		{
			this.AddAttribute<BaseMockup>("TitleContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<BaseMockup>("TitleContent", new DescriptionAttribute(StringTable.WindowTitleContentDescription));

			this.AddAttribute<BaseMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<BaseMockup>(new FeatureAttribute(typeof(BaseMockupInitializer)));
			this.AddAttribute<BaseMockup>(MetadataStore.ToolboxBrowsableFalse);	// Do not show this control in the asset panel
		}

		private void BuildAttributeTable_WebBrowserMockup()
		{
			this.AddAttribute<WebBrowserMockup>("ShowPathControls", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WebBrowserMockup>("ShowPathControls", new DescriptionAttribute(StringTable.WebBrowserShowAddressBarDescription));
			this.AddAttribute<WebBrowserMockup>("ShowPathControls", new BrowsableAttribute(true));
			this.AddAttribute<WebBrowserMockup>("ShowStatusBar", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WebBrowserMockup>("ShowStatusBar", new DescriptionAttribute(StringTable.WebBrowserShowStatusBarDescription));

			this.AddAttribute<WebBrowserMockup>("NavBarContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<WebBrowserMockup>("NavBarContent", new DescriptionAttribute(StringTable.WebBrowserNavBarContentDescription));

			this.AddAttribute<WebBrowserMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<WebBrowserMockup>("IconFill", MetadataStore.NotBrowsable);
			this.AddAttribute<WebBrowserMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<WebBrowserMockup>(new DescriptionAttribute(StringTable.WebBrowserMockupDescription)); 
			this.AddAttribute<WebBrowserMockup>(new FeatureAttribute(typeof(WebBrowserMockupInitializer)));
			this.AddAttribute<WebBrowserMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_CursorMockup()
		{
			this.AddAttribute<CursorMockup>(new DescriptionAttribute(StringTable.CursorMockupDescription)); 
			this.AddAttribute<CursorMockup>("CursorImage", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<CursorMockup>("CursorImage", new DescriptionAttribute(StringTable.CursorAppearanceDescription));
			this.AddAttribute<CursorMockup>("CursorImage", PropertyValueEditor.CreateEditorAttribute(typeof(CursorImageInlineEditor)));
			this.AddAttribute<CursorMockup>("CursorOverlay", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<CursorMockup>("CursorOverlay", new DescriptionAttribute(StringTable.CursorOverlayDescription));
			this.AddAttribute<CursorMockup>("CursorOverlay", PropertyValueEditor.CreateEditorAttribute(typeof(OverlayImageInlineEditor)));
			this.AddAttribute<CursorMockup>("CursorHighlight", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<CursorMockup>("CursorHighlight", new DescriptionAttribute(StringTable.CursorHighlightDescription));

			this.AddAttribute<CursorMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<CursorMockup>(new FeatureAttribute(typeof(CursorMockupInitializer)));
			this.AddAttribute<CursorMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_DesktopMockup()
		{
			this.AddAttribute<DesktopMockup>(new DescriptionAttribute(StringTable.DesktopMockupDescription)); 
			this.AddAttribute<DesktopMockup>("TaskbarLocation", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<DesktopMockup>("TaskbarLocation", new DescriptionAttribute(StringTable.DesktopTaskbarLocationDescription)); 
			this.AddAttribute<DesktopMockup>("StartMenuIsOpen", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<DesktopMockup>("StartMenuIsOpen", new DescriptionAttribute(StringTable.DesktopStartMenuIsOpenDescription)); 
			this.AddAttribute<DesktopMockup>("TaskbarButtonsContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DesktopMockup>("TaskbarButtonsContent", new DescriptionAttribute(StringTable.DesktopTaskBarContentDescription));
			this.AddAttribute<DesktopMockup>("StartMenuButtonsContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DesktopMockup>("StartMenuButtonsContent", new DescriptionAttribute(StringTable.DesktopStartMenuContentDescription));
			this.AddAttribute<DesktopMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<DesktopMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<DesktopMockup>(new FeatureAttribute(typeof(DesktopMockupInitializer)));
			this.AddAttribute<DesktopMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_DialogMockup()
		{
			this.AddAttribute<DialogMockup>("Button1Content", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DialogMockup>("Button1Content", new DescriptionAttribute(StringTable.DialogButtonContentDescription));
			this.AddAttribute<DialogMockup>("Button2Content", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DialogMockup>("Button2Content", new DescriptionAttribute(StringTable.DialogButtonContentDescription));
			this.AddAttribute<DialogMockup>("Button3Content", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DialogMockup>("Button3Content", new DescriptionAttribute(StringTable.DialogButtonContentDescription));

			this.AddAttribute<DialogMockup>("DialogQuestionContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DialogMockup>("DialogQuestionContent", new DescriptionAttribute(StringTable.DialogDescriptionContentDescription));

			this.AddAttribute<DialogMockup>("DialogExplanationContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<DialogMockup>("DialogExplanationContent", new DescriptionAttribute(StringTable.DialogBodyContentDescription));

			this.AddAttribute<DialogMockup>("ShowButton1", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<DialogMockup>("ShowButton1", new DescriptionAttribute(StringTable.DialogShowButtonDescription));
			this.AddAttribute<DialogMockup>("ShowButton2", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<DialogMockup>("ShowButton2", new DescriptionAttribute(StringTable.DialogShowButtonDescription));
			this.AddAttribute<DialogMockup>("ShowButton3", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<DialogMockup>("ShowButton3", new DescriptionAttribute(StringTable.DialogShowButtonDescription));

			this.AddAttribute<DialogMockup>("IconImage", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<DialogMockup>("IconImage", new DescriptionAttribute(StringTable.DialogIconImageDescription));
			this.AddAttribute<DialogMockup>("IconImage", PropertyValueEditor.CreateEditorAttribute(typeof(IconImageInlineEditor)));

			this.AddAttribute<DialogMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<DialogMockup>(new FeatureAttribute(typeof(DialogMockupInitializer)));
			this.AddAttribute<DialogMockup>(new ToolboxExampleAttribute(typeof(DialogMockupExampleFactory)));

			// dialogs don't show the StatusContent
			this.AddAttribute<DialogMockup>("StatusContent", MetadataStore.NotBrowsable);
			this.AddAttribute<DialogMockup>("ShowStatusBar", MetadataStore.NotBrowsable);
			this.AddAttribute<DialogMockup>("NavBarContent", MetadataStore.NotBrowsable);
			this.AddAttribute<DialogMockup>("Foreground", MetadataStore.NotBrowsable);

			// we use a slight variation on this description from the base Window
			this.AddAttribute<DialogMockup>("TitleContent", new DescriptionAttribute(StringTable.DialogTitleContentDescription));

			// Only show the toolbox example instances in the asset panel
			this.AddAttribute<DialogMockup>(MetadataStore.ToolboxBrowsableFalse);
			this.AddAttribute<DialogMockupExampleFactory>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_WindowsExplorerMockup()
		{
			this.AddAttribute<WindowsExplorerMockup>("ShowDetailsPane", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowsExplorerMockup>("ShowDetailsPane", new DescriptionAttribute(StringTable.WindowsExplorerShowDetailsPaneDescription));
			this.AddAttribute<WindowsExplorerMockup>("ShowPathControls", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowsExplorerMockup>("ShowPathControls", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowsExplorerMockup>("ShowMenuBar", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowsExplorerMockup>("ShowMenuBar", new DescriptionAttribute(StringTable.WindowsExplorerShowMenuBarDescription));
			this.AddAttribute<WindowsExplorerMockup>("ShowMenuBar", new BrowsableAttribute(true));

			this.AddAttribute<WindowsExplorerMockup>("NavBarContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<WindowsExplorerMockup>("NavBarContent", new DescriptionAttribute(StringTable.WindowsExplorerNavBarContentDescription));

			this.AddAttribute<WindowsExplorerMockup>("ShowStatusBar", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowsExplorerMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowsExplorerMockup>("IconFill", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowsExplorerMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<WindowsExplorerMockup>(new DescriptionAttribute(StringTable.WindowsExplorerMockupDescription)); 
			this.AddAttribute<WindowsExplorerMockup>(new FeatureAttribute(typeof(WindowsExplorerMockupInitializer)));
			this.AddAttribute<WindowsExplorerMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_ButtonWithIcon()
		{
			this.AddAttribute<ButtonWithIconMockup>(new DescriptionAttribute(StringTable.ButtonWithIconMockupDescription));
			this.AddAttribute<ButtonWithIconMockup>("IconImage", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ButtonWithIconMockup>("IconImage", new DescriptionAttribute(StringTable.IconImageDescription));
			this.AddAttribute<ButtonWithIconMockup>("IconImage", PropertyValueEditor.CreateEditorAttribute(typeof(IconImageInlineEditor)));
	
			this.AddAttribute<ButtonWithIconMockup>("IconSize", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ButtonWithIconMockup>("IconSize", new NumberRangesAttribute(0, 0, 100, null, false));
			this.AddAttribute<ButtonWithIconMockup>("IconSize", new NumberIncrementsAttribute(1, 1, 10));
			this.AddAttribute<ButtonWithIconMockup>("IconSize", new DescriptionAttribute(StringTable.IconSizeDescription));

			this.AddAttribute<ButtonWithIconMockup>("IconPlacement", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ButtonWithIconMockup>("IconPlacement", new DescriptionAttribute(StringTable.IconPlacementDescription)); 

			this.AddAttribute<ButtonWithIconMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<ButtonWithIconMockup>(new FeatureAttribute(typeof(ButtonWithIconMockupInitializer)));
		}

		private void BuildAttributeTable_IconMockup()
		{
			this.AddAttribute<IconMockup>(new DescriptionAttribute(StringTable.IconWidgetMockupDescription));
			this.AddAttribute<IconMockup>("IconImage", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<IconMockup>("IconImage", new DescriptionAttribute(StringTable.IconImageDescription));
			this.AddAttribute<IconMockup>("IconImage", PropertyValueEditor.CreateEditorAttribute(typeof(IconImageInlineEditor)));
			this.AddAttribute<IconMockup>("OriginLocation", MetadataStore.NotBrowsable);

			this.AddAttribute<IconMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<IconMockup>(new FeatureAttribute(typeof(IconMockupInitializer)));

			this.AddAttribute<IconMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_OptionButtonWithIcon()
		{
			this.AddAttribute<OptionButtonWithIconMockup>(new DescriptionAttribute(StringTable.RadioButtonWithIconMockupDescription));
			this.AddAttribute<OptionButtonWithIconMockup>("IconImage", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<OptionButtonWithIconMockup>("IconImage", new DescriptionAttribute(StringTable.IconImageDescription));
			this.AddAttribute<OptionButtonWithIconMockup>("IconImage", PropertyValueEditor.CreateEditorAttribute(typeof(IconImageInlineEditor)));

			this.AddAttribute<OptionButtonWithIconMockup>("IconSize", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<OptionButtonWithIconMockup>("IconSize", new DescriptionAttribute(StringTable.IconSizeDescription));
			this.AddAttribute<OptionButtonWithIconMockup>("IconSize", new NumberIncrementsAttribute(1, 1, 10));
			this.AddAttribute<OptionButtonWithIconMockup>("IconSize", new NumberRangesAttribute(0, 0, 100, null, false));

			this.AddAttribute<OptionButtonWithIconMockup>("IconPlacement", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<OptionButtonWithIconMockup>("IconPlacement", new DescriptionAttribute(StringTable.IconPlacementDescription));

			this.AddAttribute<OptionButtonWithIconMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<OptionButtonWithIconMockup>(new FeatureAttribute(typeof(RadioButtonWithIconMockupInitializer)));
			this.AddAttribute<OptionButtonWithIconMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_ToggleButtonWithIcon()
		{
			this.AddAttribute<ToggleButtonWithIconMockup>(new DescriptionAttribute(StringTable.ToggleButtonWithIconMockupDescription));
			this.AddAttribute<ToggleButtonWithIconMockup>("IconImage", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ToggleButtonWithIconMockup>("IconImage", new DescriptionAttribute(StringTable.IconImageDescription));
			this.AddAttribute<ToggleButtonWithIconMockup>("IconImage", PropertyValueEditor.CreateEditorAttribute(typeof(IconImageInlineEditor)));

			this.AddAttribute<ToggleButtonWithIconMockup>("IconSize", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ToggleButtonWithIconMockup>("IconSize", new DescriptionAttribute(StringTable.IconSizeDescription));
			this.AddAttribute<ToggleButtonWithIconMockup>("IconSize", new NumberIncrementsAttribute(1, 1, 10));
			this.AddAttribute<ToggleButtonWithIconMockup>("IconSize", new NumberRangesAttribute(0, 0, 100, null, false));

			this.AddAttribute<ToggleButtonWithIconMockup>("IconPlacement", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ToggleButtonWithIconMockup>("IconPlacement", new DescriptionAttribute(StringTable.IconPlacementDescription)); 

			this.AddAttribute<ToggleButtonWithIconMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<ToggleButtonWithIconMockup>(new FeatureAttribute(typeof(ToggleButtonWithIconMockupInitializer)));
			this.AddAttribute<ToggleButtonWithIconMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_LogonMockup()
		{
			this.AddAttribute<LogonMockup>(new DescriptionAttribute(StringTable.LogonMockupDescription)); 
			this.AddAttribute<LogonMockup>("UsernameContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<LogonMockup>("UsernameContent", new DescriptionAttribute(StringTable.LogonUserNameContentDescription)); 
			this.AddAttribute<LogonMockup>("PasswordContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<LogonMockup>("PasswordContent", new DescriptionAttribute(StringTable.LogonPasswordContentDescription)); 

			this.AddAttribute<LogonMockup>("Button1Content", MetadataStore.AlternateContentProperty);
			this.AddAttribute<LogonMockup>("Button1Content", new DescriptionAttribute(StringTable.LoginButtonContentDescription));
			this.AddAttribute<LogonMockup>("Button2Content", MetadataStore.AlternateContentProperty);
			this.AddAttribute<LogonMockup>("Button2Content", new DescriptionAttribute(StringTable.LoginButtonContentDescription));
			this.AddAttribute<LogonMockup>("Button3Content", MetadataStore.AlternateContentProperty);
			this.AddAttribute<LogonMockup>("Button3Content", new DescriptionAttribute(StringTable.LoginButtonContentDescription));

			this.AddAttribute<LogonMockup>("TitleContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<LogonMockup>("TitleContent", new DescriptionAttribute(StringTable.DialogTitleContentDescription));

			this.AddAttribute<LogonMockup>("ShowButton1", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<LogonMockup>("ShowButton1", new DescriptionAttribute(StringTable.LogonShowButtonDescription));
			this.AddAttribute<LogonMockup>("ShowButton2", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<LogonMockup>("ShowButton2", new DescriptionAttribute(StringTable.LogonShowButtonDescription));
			this.AddAttribute<LogonMockup>("ShowButton3", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<LogonMockup>("ShowButton3", new DescriptionAttribute(StringTable.LogonShowButtonDescription));

			this.AddAttribute<LogonMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<LogonMockup>("Background", MetadataStore.NotBrowsable);
			this.AddAttribute<LogonMockup>("BorderBrush", MetadataStore.NotBrowsable);
			this.AddAttribute<LogonMockup>("IconFill", MetadataStore.NotBrowsable);
			this.AddAttribute<LogonMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<LogonMockup>(new FeatureAttribute(typeof(LogonMockupInitializer)));
			this.AddAttribute<LogonMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_MediaControlsMockup()
		{
			this.AddAttribute<MediaControlsMockup>("ShowSeekControl", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<MediaControlsMockup>("ShowVolumeControl", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<MediaControlsMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<MediaControlsMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<MediaControlsMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<MediaControlsMockup>(new DescriptionAttribute(StringTable.MediaControlsMockupDescription)); 
			this.AddAttribute<MediaControlsMockup>(new FeatureAttribute(typeof(MediaControlsMockupInitializer)));
			this.AddAttribute<MediaControlsMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_MediaPlayerMockup()
		{
			this.AddAttribute<MediaPlayerMockup>("ShowTitleBar", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<MediaPlayerMockup>("ShowTitleBar", new DescriptionAttribute(StringTable.MediaPlayerShowTitleBarDescription));
			this.AddAttribute<MediaPlayerMockup>("ShowTitleBar", new BrowsableAttribute(true));

			this.AddAttribute<MediaPlayerMockup>("NavBarContent", MetadataStore.NotBrowsable);
			this.AddAttribute<MediaPlayerMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<MediaPlayerMockup>("Background", MetadataStore.NotBrowsable);
			this.AddAttribute<MediaPlayerMockup>("BorderBrush", MetadataStore.NotBrowsable);
			this.AddAttribute<MediaPlayerMockup>("WindowBorderFillBrush", MetadataStore.NotBrowsable);
			this.AddAttribute<MediaPlayerMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<MediaPlayerMockup>("ShowSeekControl", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<MediaPlayerMockup>("ShowVolumeControl", MetadataStore.CommonPropertiesCategory);

			this.AddAttribute<MediaPlayerMockup>(new DescriptionAttribute(StringTable.MediaPlayerMockupDescription)); 
			this.AddAttribute<MediaPlayerMockup>(new FeatureAttribute(typeof(MediaPlayerMockupInitializer)));
			this.AddAttribute<MediaPlayerMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

#if SILVERLIGHT
		private void BuildAttributeTable_MenuMockup()
		{
			this.AddAttribute<MenuMockup>(MetadataStore.MockupsToolCategory); 
			this.AddAttribute<MenuMockup>(new DescriptionAttribute(StringTable.MenuMockupDescription));
 
			this.AddAttribute<MenuMockup>("IsOpen", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<MenuMockup>("IsOpen", new DescriptionAttribute(StringTable.MenuIsOpenDescription));
			this.AddAttribute<MenuMockup>("Title", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<MenuMockup>(new FeatureAttribute(typeof(MenuMockupInitializer)));
			this.AddAttribute<MenuMockup>(MetadataStore.ToolboxBrowsableTrue);
		}
#endif

		private void BuildAttributeTable_PageSelectorMockup()
		{
			this.AddAttribute<PageSelectorMockup>(new DescriptionAttribute(StringTable.PageSelectorMockupDescription)); 
			this.AddAttribute<PageSelectorMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<PageSelectorMockup>(new FeatureAttribute(typeof(PageSelectorMockupInitializer)));
		}

		private void BuildAttributeTable_BlockOfTextMockup()
		{
			this.AddAttribute<BlockOfTextMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<BlockOfTextMockup>(new DescriptionAttribute(StringTable.BlockOfTextMockupDescription)); 
			this.AddAttribute<BlockOfTextMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<BlockOfTextMockup>(new FeatureAttribute(typeof(BlockOfTextMockupInitializer)));
		}

		private void BuildAttributeTable_ValueEditorMockup()
		{
			this.AddAttribute<ValueEditorMockup>(new DescriptionAttribute(StringTable.ValueEditorMockupDescription));
			this.AddAttribute<ValueEditorMockup>("PropertyHorizontalAlignment", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ValueEditorMockup>("PropertyHorizontalAlignment", new DescriptionAttribute(StringTable.ValueEditorPropertyHorizontalAlignmentDescription));
			this.AddAttribute<ValueEditorMockup>("ValueHorizontalAlignment", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<ValueEditorMockup>("ValueHorizontalAlignment", new DescriptionAttribute(StringTable.ValueEditorValueHorizontalAlignmentDescription));

			this.AddAttribute<ValueEditorMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<ValueEditorMockup>("IconFill", MetadataStore.NotBrowsable);
			this.AddAttribute<ValueEditorMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<ValueEditorMockup>(new FeatureAttribute(typeof(ValueEditorMockupInitializer)));
			this.AddAttribute<ValueEditorMockup>(MetadataStore.ToolboxBrowsableTrue);
		}

		private void BuildAttributeTable_WindowMockup()
		{
			this.AddAttribute<WindowMockup>(new DescriptionAttribute(StringTable.WindowMockupDescription));

			this.AddAttribute<WindowMockup>("ShowStatusBar", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowMockup>("ShowStatusBar", new DescriptionAttribute(StringTable.WindowShowStatusBarDescription));
			this.AddAttribute<WindowMockup>("ShowMinimizeButton", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowMockup>("ShowMinimizeButton", new EditorBrowsableAttribute(EditorBrowsableState.Advanced));
			this.AddAttribute<WindowMockup>("ShowMinimizeButton", new DescriptionAttribute(StringTable.WindowShowMinimizeDescription));
			this.AddAttribute<WindowMockup>("ShowMaximizeButton", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowMockup>("ShowMaximizeButton", new EditorBrowsableAttribute(EditorBrowsableState.Advanced));
			this.AddAttribute<WindowMockup>("ShowMaximizeButton", new DescriptionAttribute(StringTable.WindowShowMaximizeDescription));
			this.AddAttribute<WindowMockup>("ShowFullScreenButton", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowMockup>("ShowFullScreenButton", new EditorBrowsableAttribute(EditorBrowsableState.Advanced));
			this.AddAttribute<WindowMockup>("ShowFullScreenButton", new DescriptionAttribute(StringTable.WindowShowFullScreenDescription)); 
			this.AddAttribute<WindowMockup>("ShowCloseButton", MetadataStore.CommonPropertiesCategory);
			this.AddAttribute<WindowMockup>("ShowCloseButton", new EditorBrowsableAttribute(EditorBrowsableState.Advanced));
			this.AddAttribute<WindowMockup>("ShowCloseButton", new DescriptionAttribute(StringTable.WindowShowCloseDescription));

			this.AddAttribute<WindowMockup>("StatusContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<WindowMockup>("StatusContent", new DescriptionAttribute(StringTable.WindowStatusContentDescription));
			this.AddAttribute<WindowMockup>("TitleContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<WindowMockup>("TitleContent", new DescriptionAttribute(StringTable.WindowTitleContentDescription));
			this.AddAttribute<WindowMockup>("NavBarContent", MetadataStore.AlternateContentProperty);
			this.AddAttribute<WindowMockup>("NavBarContent", new DescriptionAttribute(StringTable.WebBrowserNavBarContentDescription));

			this.AddAttribute<WindowMockup>("ShowLowerBar", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("LowerBarContent", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("ShowMenuBar", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("MenuBarContent", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("ShowPathControls", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("ShowTitleText", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("ShowTitleBar", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("WindowBorderThickness", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("Foreground", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("IconFill", MetadataStore.NotBrowsable);
			this.AddAttribute<WindowMockup>("IconStroke", MetadataStore.NotBrowsable);

			this.AddAttribute<WindowMockup>(MetadataStore.MockupsToolCategory);
			this.AddAttribute<WindowMockup>(new FeatureAttribute(typeof(WindowMockupInitializer)));
			this.AddAttribute<WindowMockup>(MetadataStore.ToolboxBrowsableTrue);
		}
		#endregion

		#region InitializerHelpers
		public static class InitializerHelper
		{
			public static string GenerateResourceReference(string resourceKey)
			{
#if SILVERLIGHT
				string resourceReference = String.Format(CultureInfo.InvariantCulture, "{{StaticResource {0}}}", resourceKey);
				return resourceReference;
#else
				string resourceReference = String.Format(CultureInfo.InvariantCulture, "{{DynamicResource {0}}}", resourceKey);
				return resourceReference;
#endif
			}
		}

		internal static class DefaultInitializerHelper
		{
			public static ModelItem CreateGrid(EditingContext context, string newBackground)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(Grid));
				newControl.Properties["MinWidth"].SetValue("8");
				newControl.Properties["MinHeight"].SetValue("8");
				newControl.Properties["Background"].SetValue(newBackground);
				return newControl;
			}

			public static ModelItem CreateTextBlock(EditingContext context, object content)
			{
				return CreateTextBlock(context, content, null);
			}

			public static ModelItem CreateTextBlock(EditingContext context, object content, ModelItem container)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(TextBlock));
				newControl.Properties["Text"].SetValue(content);
				newControl.Properties["Margin"].SetValue("4");
				newControl.Properties["Style"].SetValue(InitializerHelper.GenerateResourceReference("BasicTextBlock-Sketch"));

				if (container != null)
				{
					container.Properties["Children"].Collection.Add(newControl);
				}

				return newControl;
			}

			public static ModelItem CreateTextBox(EditingContext context, object content)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(TextBox));
				newControl.Properties["Text"].SetValue(content);
				newControl.Properties["Margin"].SetValue("4");
				newControl.Properties["Padding"].SetValue("4,0,0,0");
				newControl.Properties["Style"].SetValue(InitializerHelper.GenerateResourceReference("BasicTextBox-Sketch"));
				return newControl;
			}

			public static ModelItem CreateStackPanel(EditingContext context, string newBackground, string orientation)
			{
				return CreateStackPanel(context, newBackground, orientation, null);
			}

			public static ModelItem CreateStackPanel(EditingContext context, string newBackground, string orientation, ModelItem container)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(StackPanel));
				newControl.Properties["MinWidth"].SetValue("8");
				newControl.Properties["MinHeight"].SetValue("8");
				newControl.Properties["Background"].SetValue(newBackground);

				if (orientation != null)
				{
					newControl.Properties["Orientation"].SetValue(orientation);
				}

				if (container != null)
				{
					container.Properties["Content"].SetValue(newControl);
				}

				return newControl;
			}

			public static ModelItem CreateWrapPanel(EditingContext context, string newBackground)
			{
				return CreateWrapPanel(context, newBackground, null);
			}

			public static ModelItem CreateWrapPanel(EditingContext context, string newBackground, ModelItem container)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(Mockups.MiniWrapPanel));
				newControl.Properties["MinWidth"].SetValue("8");
				newControl.Properties["MinHeight"].SetValue("8");
				newControl.Properties["Background"].SetValue(newBackground);

				if (container != null)
				{
					container.Properties["Content"].SetValue(newControl);
				}

				return newControl;
			}

			public static ModelItem CreateUniformGrid(EditingContext context, string newBackground, int? columns, int? rows, ModelItem container)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(Mockups.UniformGrid));
				newControl.Properties["MinWidth"].SetValue("8");
				newControl.Properties["MinHeight"].SetValue("8");

				if (columns != null)
				{
					newControl.Properties["Columns"].SetValue(columns);
				}

				if (rows != null)
				{
					newControl.Properties["Rows"].SetValue(rows);
				}

				if (newBackground != null)
				{
					newControl.Properties["Background"].SetValue(newBackground);
				}

				if (container != null)
				{
					container.Properties["Content"].SetValue(newControl);
				}

				return newControl;
			}

			public static ModelItem CreateButton(EditingContext context, object content)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(Button));
				newControl.Properties["Content"].SetValue(content);
				newControl.Properties["Style"].SetValue(InitializerHelper.GenerateResourceReference("Button-Sketch"));

				return newControl;
			}

			public static ModelItem CreateIconRadioButton(EditingContext context, object content, string IconImageName, ModelItem container)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(Mockups.OptionButtonWithIconMockup), CreateOptions.InitializeDefaults);
				newControl.Properties["Content"].SetValue(content);
				newControl.Properties["IconImage"].SetValue(IconImageName);

				if (container != null)
				{
					container.Content.Collection.Add(newControl);
				}

				return newControl;
			}

			public static ModelItem CreateIconButton(EditingContext context, object content, string iconImageName, ModelItem container)
			{
				return CreateIconButton(context, content, iconImageName, null, null, container);
			}

			public static ModelItem CreateIconButton(EditingContext context, object content, string iconImageName, string newBackground, string newBorderBrush, ModelItem container)
			{
				ModelItem newControl = ModelFactory.CreateItem(context, typeof(Mockups.ButtonWithIconMockup), CreateOptions.InitializeDefaults);
				newControl.Properties["Content"].SetValue(content);
				newControl.Properties["IconImage"].SetValue(iconImageName);
				newControl.Properties["Background"].SetValue(newBackground);
				newControl.Properties["BorderBrush"].SetValue(newBorderBrush);

				if (container != null)
				{
					container.Content.Collection.Add(newControl);
				}

				return newControl;
			}

			public static ModelItem CreateIconButtonClear(EditingContext context, object content, string iconImageName, ModelItem container)
			{
				ModelItem newControl = CreateIconButton(context, content, iconImageName, container);
				newControl.Properties["Background"].SetValue("{x:Null}");
				newControl.Properties["HorizontalContentAlignment"].SetValue("Left");
				newControl.Properties["HorizontalAlignment"].SetValue("Left");
				return newControl;
			}
		}
		#endregion

		#region MockupInitializers
		internal class BaseMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("100");
				item.Properties["Height"].SetValue("100");

				item.Properties["Content"].SetValue(DefaultInitializerHelper.CreateGrid(item.Context, null));
				item.Properties["TitleContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.BaseMockupTitleContent));
			}
		}

#if SILVERLIGHT
		internal class MenuMockupInitializer : DefaultInitializer
		{
			// Dictionary of menu item and menu item icon names.
			private static Dictionary<string, string> DefaultTopLevelSubMenus = new Dictionary<string, string>()
			{
				{StringTable.MenuMockupSubMenuNew, IconImage.NewFile.ToString()},
				{StringTable.MenuMockupSubMenuOpen, IconImage.OpenFile.ToString()},
				{StringTable.MenuMockupSubMenuSave, IconImage.Document.ToString()}, 
				{StringTable.MenuMockupSubMenuExit, IconImage.Delete.ToString()}
			};

			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("100");
				item.Properties["Height"].SetValue("100");

				item.Properties["Content"].SetValue(DefaultInitializerHelper.CreateGrid(item.Context, null));

				MenuMockupInitializer.InitializeMenuItem(item, MenuMockupInitializer.DefaultTopLevelSubMenus);
				item.Properties["Title"].SetValue(StringTable.MenuMockupMenuFile);
			}

			internal static void InitializeMenuItem(ModelItem item, Dictionary<string, string> subMenus)
			{
				item.Properties["Width"].SetValue("Auto");
				item.Properties["Height"].SetValue("Auto");

				ModelItem menuItemsContainer = DefaultInitializerHelper.CreateStackPanel(item.Context, null, "Vertical", item);

				foreach (KeyValuePair<string, string> subMenu in subMenus)
				{
					ModelItem menuItem = DefaultInitializerHelper.CreateIconButtonClear(item.Context, subMenu.Key, subMenu.Value, menuItemsContainer);
					menuItem.Properties["Margin"].SetValue("4,0,20,0");
					menuItem.Properties["Padding"].SetValue("3,0");
				}
			}
		}
#endif

		internal class WindowMockupInitializer : BaseMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("400");
				item.Properties["Height"].SetValue("300");

				ModelItem titleContentValue = item.Properties["TitleContent"].Value;
				titleContentValue.Properties["Text"].SetValue(StringTable.WindowMockupTitleContent);
				titleContentValue.Properties["Margin"].SetValue("4,4,4,0");

				item.Properties["StatusContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.WindowMockupContentStatus));
				item.Properties["MenuBarContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.WindowMockupContentMenuBar));
				item.Properties["NavBarContent"].SetValue(DefaultInitializerHelper.CreateTextBox(item.Context, StringTable.WindowMockupContentNavBar));
				item.Properties["LowerBarContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.WindowMockupContentLowerBar));
			}
		}

		internal class DialogMockupInitializer : WindowMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				ModelItem titleContentValue = item.Properties["TitleContent"].Value;
				titleContentValue.Properties["Text"].SetValue(StringTable.DialogMockupTitleContent);

				item.Properties["Width"].SetValue("450");
				item.Properties["Height"].SetValue("200");

				item.Properties["Background"].SetValue(InitializerHelper.GenerateResourceReference("BaseBackground-Sketch"));
				item.Properties["BorderBrush"].SetValue(InitializerHelper.GenerateResourceReference("BaseBorder-Sketch"));

				ModelItem dialogButton1 = DefaultInitializerHelper.CreateButton(item.Context, StringTable.ButtonApply);
				dialogButton1.Properties["Padding"].SetValue("6,3");

				ModelItem dialogButton2 = DefaultInitializerHelper.CreateButton(item.Context, StringTable.ButtonOK);
				dialogButton2.Properties["Padding"].SetValue("6,3");

				ModelItem dialogButton3 = DefaultInitializerHelper.CreateButton(item.Context, StringTable.ButtonCancel);
				dialogButton3.Properties["Padding"].SetValue("6,3");

				item.Properties["Button1Content"].SetValue(dialogButton1);
				item.Properties["Button2Content"].SetValue(dialogButton2);
				item.Properties["Button3Content"].SetValue(dialogButton3);

				item.Properties["DialogQuestionContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.DialogMockupContentDialogQuestion));
				ModelItem contentDialogQuestionValue = item.Properties["DialogQuestionContent"].Value;
				contentDialogQuestionValue.Properties["TextWrapping"].SetValue("Wrap");
				contentDialogQuestionValue.Properties["FontSize"].SetValue("24");

				item.Properties["DialogExplanationContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.DialogMockupContentDialogExplanation));
				ModelItem contentDialogExplanationValue = item.Properties["DialogExplanationContent"].Value;
				contentDialogExplanationValue.Properties["TextWrapping"].SetValue("Wrap");
			}
		}

		internal class WebBrowserMockupInitializer : WindowMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("550");
				item.Properties["Height"].SetValue("400");

				ModelItem titleContentValue = item.Properties["TitleContent"].Value;
				titleContentValue.Properties["Padding"].SetValue("4,3,0,0");
				titleContentValue.Properties["Text"].SetValue(StringTable.WebBrowserMockupTitleContent);

				ModelItem contentStatusValue = item.Properties["StatusContent"].Value;
				contentStatusValue.Properties["Padding"].SetValue("4,3,0,0");
				contentStatusValue.Properties["Text"].SetValue(StringTable.WebBrowserMockupContentStatus);

				ModelItem contentNavBarValue = item.Properties["NavBarContent"].Value;
				contentNavBarValue.Properties["Text"].SetValue(StringTable.WebBrowserMockupContentNavBar);
				contentNavBarValue.Properties["Margin"].SetValue("0.0");
				contentNavBarValue.Properties["Padding"].SetValue("4,3,0,0");
				contentNavBarValue.Properties["Background"].SetValue("Transparent");
				contentNavBarValue.Properties["BorderBrush"].SetValue("Transparent");
			}
		}

		internal class WindowsExplorerMockupInitializer : WindowMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("640");
				item.Properties["Height"].SetValue("480");

				ModelItem titleContentValue = item.Properties["TitleContent"].Value;
				titleContentValue.Properties["Text"].SetValue(StringTable.WindowsExplorerMockupTitleContent);

				ModelItem contentStatusValue = item.Properties["StatusContent"].Value;
				contentStatusValue.Properties["Text"].SetValue(StringTable.WindowsExplorerMockupContentStatus);

				ModelItem contentNavBarValue = item.Properties["NavBarContent"].Value;
				contentNavBarValue.Properties["Text"].SetValue(StringTable.WindowsExplorerMockupContentNavBar);
				contentNavBarValue.Properties["Margin"].SetValue("0.0");
				contentNavBarValue.Properties["Padding"].SetValue("4,3,0,0");
				contentNavBarValue.Properties["Background"].SetValue("Transparent");
				contentNavBarValue.Properties["BorderBrush"].SetValue("Transparent");
			}
		}

		internal class LogonMockupInitializer : BaseMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("395");
				item.Properties["Height"].SetValue("Auto");

				ModelItem titleContentValue = item.Properties["TitleContent"].Value;
				titleContentValue.Properties["Text"].SetValue(StringTable.LogonMockupTitleContent);
				titleContentValue.Properties["Style"].SetValue(InitializerHelper.GenerateResourceReference("SubtitleLeft-Sketch"));

				ModelItem logonMockup1 = DefaultInitializerHelper.CreateButton(item.Context, StringTable.LogonMockupButton1);
				logonMockup1.Properties["Margin"].SetValue("4,0");
				logonMockup1.Properties["Padding"].SetValue("6,3");

				ModelItem logonMockup2 = DefaultInitializerHelper.CreateButton(item.Context, StringTable.LogonMockupButton2);
				logonMockup2.Properties["Margin"].SetValue("0");
				logonMockup2.Properties["Padding"].SetValue("6,3");

				ModelItem logonMockup3 = DefaultInitializerHelper.CreateButton(item.Context, StringTable.LogonMockupButton3);
				logonMockup3.Properties["Margin"].SetValue("8,0,0,0");
				logonMockup3.Properties["Padding"].SetValue("6,3");

				item.Properties["Button1Content"].SetValue(logonMockup1);
				item.Properties["Button2Content"].SetValue(logonMockup2);
				item.Properties["Button3Content"].SetValue(logonMockup3);

				ModelItem usernameValueEditor = ModelFactory.CreateItem(item.Context, typeof(ValueEditorMockup));
				usernameValueEditor.Properties["TitleContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, "Username:"));
				usernameValueEditor.Properties["Content"].SetValue(DefaultInitializerHelper.CreateTextBox(item.Context, StringTable.LogonMockupContentUsername));
				usernameValueEditor.Properties["PropertyHorizontalAlignment"].SetValue("Right");
				ModelItem textBoxValue = usernameValueEditor.Properties["Content"].Value;
				textBoxValue.Properties["BorderBrush"].SetValue("Transparent");
				item.Properties["UsernameContent"].SetValue(usernameValueEditor);

				ModelItem passwordValueEditor = ModelFactory.CreateItem(item.Context, typeof(ValueEditorMockup));
				passwordValueEditor.Properties["TitleContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, "Password:"));
				passwordValueEditor.Properties["Content"].SetValue(DefaultInitializerHelper.CreateTextBox(item.Context, StringTable.LogonMockupContentPassword));
				passwordValueEditor.Properties["PropertyHorizontalAlignment"].SetValue("Right");
				textBoxValue = passwordValueEditor.Properties["Content"].Value;
				textBoxValue.Properties["BorderBrush"].SetValue("Transparent");
				item.Properties["PasswordContent"].SetValue(passwordValueEditor);
			}
		}

		internal class CursorMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("32");
				item.Properties["Height"].SetValue("32");

			}
		}

		internal class PageSelectorMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Content"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.PageSelectorContent));
			}
		}

		internal class BlockOfTextMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("150");
				item.Properties["Content"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.LoremIpsum));

				ModelItem contentValue = item.Properties["Content"].Value;
				contentValue.Properties["TextWrapping"].SetValue("Wrap");
				contentValue.Properties["FontSize"].SetValue("13.333");
			}
		}

		internal class DesktopMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("640");
				item.Properties["Height"].SetValue("480");
				item.Properties["TaskbarButtonsContent"].SetValue(DefaultInitializerHelper.CreateWrapPanel(item.Context, null));

				ModelItem contentTaskbarButtonsValue = item.Properties["TaskbarButtonsContent"].Value;
				ModelItem taskbarButton1 = DefaultInitializerHelper.CreateIconRadioButton(item.Context, StringTable.DesktopMockupTaskBarButtonVideo, IconImage.Document.ToString(), contentTaskbarButtonsValue);
				ModelItem taskbarButton2 = DefaultInitializerHelper.CreateIconRadioButton(item.Context, StringTable.DesktopMockupTaskBarButtonMusic, IconImage.Play.ToString(), contentTaskbarButtonsValue);
				ModelItem taskbarButton3 = DefaultInitializerHelper.CreateIconRadioButton(item.Context, StringTable.DesktopMockupTaskBarButtonFiles, IconImage.Folder.ToString(), contentTaskbarButtonsValue);

				taskbarButton1.Properties["Margin"].SetValue("2,4,2,4");
				taskbarButton1.Properties["Padding"].SetValue("6,3");
				taskbarButton2.Properties["Margin"].SetValue("2,4,2,4");
				taskbarButton2.Properties["Padding"].SetValue("6,3");
				taskbarButton3.Properties["Margin"].SetValue("2,4,2,4");
				taskbarButton3.Properties["Padding"].SetValue("6,3");

				item.Properties["StartMenuButtonsContent"].SetValue(DefaultInitializerHelper.CreateStackPanel(item.Context, null, "Vertical"));
				ModelItem contentStartmenuButtonsValue = item.Properties["StartMenuButtonsContent"].Value;

				ModelItem startmenuButton1 = DefaultInitializerHelper.CreateIconButtonClear(item.Context, StringTable.DesktopMockupStartMenuButtonSpreadsheet, IconImage.Document.ToString(), contentStartmenuButtonsValue);
				ModelItem startmenuButton2 = DefaultInitializerHelper.CreateIconButtonClear(item.Context, StringTable.DesktopMockupStartMenuButtonMaps, IconImage.Document.ToString(), contentStartmenuButtonsValue);
				ModelItem startmenuButton3 = DefaultInitializerHelper.CreateIconButtonClear(item.Context, StringTable.DesktopMockupStartMenuButtonPaint, IconImage.Document.ToString(), contentStartmenuButtonsValue);
				ModelItem startmenuButton4 = DefaultInitializerHelper.CreateIconButtonClear(item.Context, StringTable.DesktopMockupStartMenuButtonNotes, IconImage.Document.ToString(), contentStartmenuButtonsValue);
				ModelItem startmenuButton5 = DefaultInitializerHelper.CreateIconButtonClear(item.Context, StringTable.DesktopMockupStartMenuButtonContacts, IconImage.Document.ToString(), contentStartmenuButtonsValue);
				ModelItem startmenuButton6 = DefaultInitializerHelper.CreateIconButtonClear(item.Context, StringTable.DesktopMockupStartMenuButtonSearch, IconImage.Document.ToString(), contentStartmenuButtonsValue);
			}
		}

		internal class ValueEditorMockupInitializer : BaseMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("350");
				item.Properties["Height"].SetValue("Auto");

				item.Properties["TitleContent"].SetValue(DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.ValueEditorMockupContentPropertyLabel));

				item.Properties["Content"].SetValue(DefaultInitializerHelper.CreateTextBox(item.Context, StringTable.ValueEditorMockupContentValueLabel));
				ModelItem sampleValue = item.Properties["Content"].Value;
				sampleValue.Properties["BorderBrush"].SetValue("Transparent");
			}
		}

		internal class MediaControlsMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("250");
				item.Properties["Height"].SetValue("64");
			}
		}

		internal class MediaPlayerMockupInitializer : WindowMockupInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Width"].SetValue("384");
				item.Properties["Height"].SetValue("278");

				ModelItem titleContentValue = item.Properties["TitleContent"].Value;
				titleContentValue.Properties["Text"].SetValue(StringTable.MediaPlayerMockupTitleContent);

				ModelItem contentStatusValue = item.Properties["StatusContent"].Value;
				contentStatusValue.Properties["Text"].SetValue(StringTable.MediaPlayerMockupContentStatus);

				//NOTE: This creates a textBlock and then places it inside of the existing Content grid
				ModelItem mediaText = DefaultInitializerHelper.CreateTextBlock(item.Context, StringTable.MediaPlayerMockupContentText);
				mediaText.Properties["Foreground"].SetValue("White");
				ModelItem contentValue = item.Properties["Content"].Value;
				contentValue.Content.Collection.Add(mediaText);
				contentValue.Properties["Background"].SetValue("Black");
			}
		}

		internal class IconMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Height"].SetValue("32");
				item.Properties["Width"].SetValue("32");
			}
		}

		internal class ButtonWithIconMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Content"].SetValue(item.ItemType.Name);
			}
		}

		internal class ToggleButtonWithIconMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Content"].SetValue(item.ItemType.Name);
			}
		}

		internal class RadioButtonWithIconMockupInitializer : DefaultInitializer
		{
			public override void InitializeDefaults(ModelItem item)
			{
				item.Properties["Content"].SetValue(item.ItemType.Name);
			}
		}
		#endregion
	}
}
